#!/usr/bin/env python
# -*—coding:utf8-*-
# @author: flame
# @file: count_times.py
# @time: 2023/10/10 13:38


def count_times(func):
    count = 0

    def inner(*args, **kwargs):
        nonlocal count
        count += 1
        print(f"该函数{func.__name__} 已经被调用 {count} 次")
        return func(*args, **kwargs)
    return inner


@count_times
def hello(str1):
    print(f'hello,{str1}')


hello('a')
hello('b')
hello('world')


